﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using _1.OrderService.Query;

namespace _1.OrderService
{
    public partial class QueryForm : Form
    {
        Form1 _form1;
        OrderService _orderService;
        public QueryForm(Form1 form1, OrderService orderService)
        {
            InitializeComponent();
            _form1 = form1;
            _orderService = orderService;
        }

        private void QueryForm_Load(object sender, EventArgs e)
        {

        }

        private void button_quit_Click(object sender, EventArgs e)
        {
            _form1.Show();
            this.Close();
        }

        private void button_all_Click(object sender, EventArgs e)
        {
            QueryAllForm queryAllForm = new QueryAllForm(this, _orderService);
            queryAllForm.Show();
            this.Hide();
        }

        private void button_byID_Click(object sender, EventArgs e)
        {
            QueryByIdForm queryByIdForm = new QueryByIdForm(this, _orderService);
            queryByIdForm.Show();
            this.Hide();
        }

        private void button_byProduct_Click(object sender, EventArgs e)
        {
            QueryByProductForm queryByProductForm = new QueryByProductForm(this, _orderService);
            queryByProductForm.Show();
            this.Hide();
        }

        private void button_byCustom_Click(object sender, EventArgs e)
        {
            QueryByCustomForm queryByCustomForm = new QueryByCustomForm(this, _orderService);
            this.Hide();
            queryByCustomForm.Show();
        }

        private void button_byMoney_Click(object sender, EventArgs e)
        {
            QueryByMoneyForm queryByMoneyForm = new QueryByMoneyForm(this,_orderService);
            queryByMoneyForm.Show();
            this.Hide();
        }
    }
}
